package com.ebupt.migu.music.iop.mapper;

import com.baomidou.dynamic.datasource.annotation.DS;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.ebupt.migu.music.iop.pojo.IopTagCollect;
import com.ebupt.migu.music.system.entity.SysUser;

/**
 *  收藏标签
 * @author tz
 */
@DS("mysql_mg")
public interface IopTagCollectMapper extends BaseMapper<IopTagCollect> {

    /**
     *  根据用户查收藏标签
     * @param user
     * @return
     */
    default IopTagCollect selectByUser(SysUser user){
        return this.selectOne(new QueryWrapper<IopTagCollect>().lambda()
                .eq(IopTagCollect::getUserId,user.getId()));
    }
}
